/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = jolt_mar.h                                         */
/*  NOTE      =                                                    */
/*  DATE      = 2015/06/03 by songbb                               */
/*******************************************************************/

#ifndef __JOLT_MAR_H_
#define __JOLT_MAR_H_

/**
 * Jolt数据类型
 */
#define APM_JOLT_SSHORT 0
#define APM_JOLT_SINT 1
#define APM_JOLT_SBYTE 2
#define APM_JOLT_SFLOAT 3
#define APM_JOLT_SDOUBLE 4
#define APM_JOLT_SSTRING 5
#define APM_JOLT_SBINARY 6
#define APM_JOLT_SSTRUCT 7
#define APM_JOLT_SMBSTRING 8
#define APM_JOLT_SBOOLEAN 9
#define APM_JOLT_SLONG 10

/**
 * Jolt字符串encode类型
 */
#define APM_JOLT_UTFSTR 0
#define APM_JOLT_UNICODESTR 1
#define APM_JOLT_ENCODESTR 2

/**
 * Jolt字符串缓存大小
 */
#define APM_JOLT_STRING_BUFSIZ 256

int jolt_mar_get_short(unsigned int ui_msgparam
                    , L7_jolt_packet *p_st_jolt_packet
                    , short *p_s_out);

int jolt_mar_get_int(unsigned int ui_msgparam
                    , L7_jolt_packet *p_st_jolt_packet
                    , int *p_i_out);

int jolt_mar_get_byte(unsigned int ui_msgparam
                    , L7_jolt_packet *p_st_jolt_packet
                    , char *p_c_out);

int jolt_mar_get_boolean(unsigned int ui_msgparam
                        , L7_jolt_packet *p_st_jolt_packet
                        , int *p_i_out);

int jolt_mar_get_long(unsigned int ui_msgparam
                    , L7_jolt_packet *p_st_jolt_packet
                    , long long *p_ll_out);

int jolt_mar_get_float(unsigned int ui_msgparam
                    , L7_jolt_packet *p_st_jolt_packet
                    , float *p_f_out);

int jolt_mar_get_double(unsigned int ui_msgparam
                    , L7_jolt_packet *p_st_jolt_packet
                    , double *p_d_out);

int jolt_mar_get_string(L7session_jolt *p_st_jolt_sess
                    , unsigned int ui_msgparam
                    , L7_jolt_packet *p_st_jolt_packet
                    , char **pp_out
                    , unsigned int *p_ui_out_len);

int jolt_mar_get_bytes(unsigned int ui_msgparam
                    , L7_jolt_packet *p_st_jolt_packet
                    , char **pp_out
                    , unsigned int *p_ui_out_len);

int jolt_mar_get_struct(unsigned int ui_msgparam
                    , L7_jolt_packet *p_st_jolt_packet
                    , char **pp_out
                    , unsigned int *p_ui_out_len);

#endif
